<script>
init({
  title: 'Footer Field',
  desc: 'Use the `footerField` option to set the footer data key of the server response',
  links: ['bootstrap-table.min.css'],
  scripts: ['bootstrap-table.min.js']
})
</script>

<template>
  <table
    id="table"
    data-toggle="table"
    data-height="460"
    data-show-columns="true"
    data-show-footer="true"
    data-pagination="true"
    data-side-pagination="server"
    data-data-field="items"
    data-url="json/footerField.json"
  >
    <thead>
      <tr>
        <th
          data-field="id"
          data-footer-formatter="idFormatter"
        >
          ID
        </th>
        <th
          data-field="name"
          data-footer-formatter="nameFormatter"
        >
          Item Name
        </th>
        <th
          data-field="price"
          data-footer-formatter="priceFormatter"
        >
          Item Price
        </th>
      </tr>
    </thead>
  </table>
</template>

<script>
  window.idFormatter = (data, footerValue) => footerValue

  window.nameFormatter = (data, footerValue) => footerValue

  window.priceFormatter = (data, footerValue) => footerValue
</script>
